// 评论
import request from '@/utils/request'
// 获取评论列表
export const getcommentlistAPI = ({ artid, offest = null, limit = 10 }) => {
  return request({
    url: '/v1_0/comments',
    params: {
      // axios的parmas如果值是nul,key和value则会忽略
      type: 'a',
      source: artid,
      offset: offest,
      limit: limit
    }
  })
}

// 评论喜欢
export const likecommentAPI = ({ target }) => {
  return request({
    url: '/v1_0/comment/likings',
    method: 'POST',
    data: {
      target: target
    }
  })
}

// 评论不喜欢
export const dislikecommentAPI = ({ id }) => {
  return request({
    url: `/v1_0/comment/likings/${id}`,
    method: 'DELETE'

  })
}

// 评论发布
export const sendcommentAPI = ({ target, content }) => {
  return request({
    url: '/v1_0/comments',
    method: 'POST',
    data: {
      content: content,
      target: target
    }
  })
}
